//
//  TTSearchTagViewCell.m
//  TaoTuo
//
//  Created by admin on 2019/8/20.
//  Copyright © 2019 admin. All rights reserved.
//

#import "TTSearchTagViewCell.h"

@interface TTSearchTagViewCell ()


@end

@implementation TTSearchTagViewCell

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        
        self.backgroundColor = UIColorHex(F0F4F7);
        _normalTitleLabel = [UILabel labelTextCenterWithTitle:@"" color:UIColorHex(666666) fontSize:13];
        [self addSubview:_normalTitleLabel];
        
    }
    return self;
}

- (void)setTitle:(NSString *)title cornerRadius:(CGFloat)cornerRadius
{
    self.normalTitleLabel.text = title;
    self.layer.cornerRadius = cornerRadius;
    self.normalTitleLabel.layer.cornerRadius = cornerRadius;
}

- (void)layoutSubviews
{
    [super layoutSubviews];
    
    self.normalTitleLabel.frame = self.bounds;
}

- (void)setSelected:(BOOL)selected
{
    [super setSelected:selected];
    
    if (selected) {
        self.normalTitleLabel.textColor = self.selectedTitleColor ? : [UIColor whiteColor];
        self.normalTitleLabel.layer.backgroundColor = self.selectedBackgroundColor.CGColor ? : kMainColor.CGColor;
    } else {
        self.normalTitleLabel.textColor = self.normalTitleColor ? : UIColorHex(666666);
        self.normalTitleLabel.layer.backgroundColor = self.normalBackgroundColor.CGColor ? : [UIColor clearColor].CGColor;
    }
}

- (void)setNormalBackgroundColor:(UIColor *)normalBackgroundColor
{
    _normalBackgroundColor = normalBackgroundColor;
    self.backgroundColor = normalBackgroundColor;
}

- (void)setNormalTitleColor:(UIColor *)normalTitleColor
{
    _normalTitleColor = normalTitleColor;
    self.normalTitleLabel.textColor = normalTitleColor;
}

//- (void)setSelectedTitleColor:(UIColor *)selectedTitleColor
//{
//    _selectedTitleColor = selectedTitleColor;
////    self.normalTitleLabel.selectedTitleColor = selectedTitleColor;
//}

- (void)setBoardColor:(UIColor *)boardColor
{
    _boardColor = boardColor;
    self.layer.borderColor = boardColor.CGColor;
}

- (void)setBoardWidth:(CGFloat)boardWidth
{
    _boardWidth = boardWidth;
    self.layer.borderWidth = boardWidth;
}

@end
